<?php
namespace app\admin\validate;

use think\Validate;

class StudentValidate extends  Validate {

    const SCENE_ADD = 'add';

    const SCENE_EDIT = 'edit';

    protected $rule = [
       'id' => 'require',
       'weight' => 'require',
       'study_date' => 'require',
       'study_hours' => 'require',
       'content' => 'require',
       'status' => 'require',
   ];


    protected $message = [
        'id' => 'id不可为空',
        'weight' => 'weight不可为空',
        'study_date' => 'study_date学习日期不能为空',
        'study_hours' => 'study_hours学习时长不能为空',
        'content' => 'content内容不能为空',
        'status' => 'status不可为空',
    ];


    protected $scene = [
        'add'  =>  ["weight","study_date","study_hours","content","status"],
        'edit'  =>  ["id","weight","study_date","study_hours","content","status"]
    ];

}